package decorator;

/**
 * @Author liangliangzhao
 * @data 2023/4/12 15:19
 */

public class Decorator extends Drink{
    private Drink obj;
    public Decorator(Drink drink){
        this.obj = drink;
    }
    @Override
    public float cost() {
        // 自己的价格 + Drink的价格
        return super.getPrice() + obj.cost();
    }
    @Override
    public String getDes() {
        return des + " " + getPrice() + " &&" + obj.getDes();
    }
}
